
/* Copyright 2018 JDCLOUD.COM

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http:#www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

密钥管理服务
基于硬件保护密钥的安全数据托管服务

OpenAPI spec version: v1
Contact: 

NOTE: This class is auto generated by the jdcloud code generator program.
*/

#import <Foundation/Foundation.h>

#import <JDCloudOCSDKKms/KmsExecutor.h>


/// 获取非对称密钥的公钥
@implementation  KmsGetPublicKeyExecutor

-(id) initWithJDCloudClient:(KmsClient*)JDCloudClient
{
    self.jdCloudClient = JDCloudClient;
    self.method = @"GET";
    self.url = @"/key/{keyId}:GetPublicKey";
    return self;
}
@end

/// 获取密钥列表
@implementation  KmsDescribeKeyListExecutor

-(id) initWithJDCloudClient:(KmsClient*)JDCloudClient
{
    self.jdCloudClient = JDCloudClient;
    self.method = @"GET";
    self.url = @"/key";
    return self;
}
@end

/// 修改机密指定版本配置
@implementation  KmsUpdateSecretVersionExecutor

-(id) initWithJDCloudClient:(KmsClient*)JDCloudClient
{
    self.jdCloudClient = JDCloudClient;
    self.method = @"PATCH";
    self.url = @"/secret/{secretId}/version/{version}";
    return self;
}
@end

/// 从KMS中获取一对数据密钥的明文/密文
@implementation  KmsGenerateDataKeyExecutor

-(id) initWithJDCloudClient:(KmsClient*)JDCloudClient
{
    self.jdCloudClient = JDCloudClient;
    self.method = @"GET";
    self.url = @"/key/{keyId}:GenerateDataKey";
    return self;
}
@end

/// 创建机密
@implementation  KmsCreateSecretExecutor

-(id) initWithJDCloudClient:(KmsClient*)JDCloudClient
{
    self.jdCloudClient = JDCloudClient;
    self.method = @"POST";
    self.url = @"/secret:create";
    return self;
}
@end

/// 启用指定版本密钥
@implementation  KmsEnableKeyVersionExecutor

-(id) initWithJDCloudClient:(KmsClient*)JDCloudClient
{
    self.jdCloudClient = JDCloudClient;
    self.method = @"PATCH";
    self.url = @"/key/{keyId}/version/{version}:enable";
    return self;
}
@end

/// 使用密钥对数据进行加密，针对非对称密钥：使用公钥进行加密，仅支持RSA_PKCS1_PADDING填充方式，最大加密数据长度为245字节
@implementation  KmsEncryptExecutor

-(id) initWithJDCloudClient:(KmsClient*)JDCloudClient
{
    self.jdCloudClient = JDCloudClient;
    self.method = @"POST";
    self.url = @"/key/{keyId}:Encrypt";
    return self;
}
@end

/// 启用当前状态为&#x60;已禁用&#x60;的密钥
@implementation  KmsEnableKeyExecutor

-(id) initWithJDCloudClient:(KmsClient*)JDCloudClient
{
    self.jdCloudClient = JDCloudClient;
    self.method = @"PATCH";
    self.url = @"/key/{keyId}:enable";
    return self;
}
@end

/// 取消删除密钥
@implementation  KmsCancelKeyDeletionExecutor

-(id) initWithJDCloudClient:(KmsClient*)JDCloudClient
{
    self.jdCloudClient = JDCloudClient;
    self.method = @"PATCH";
    self.url = @"/key/{keyId}:cancelDelete";
    return self;
}
@end

/// 删除机密
@implementation  KmsDeleteSecretExecutor

-(id) initWithJDCloudClient:(KmsClient*)JDCloudClient
{
    self.jdCloudClient = JDCloudClient;
    self.method = @"DELETE";
    self.url = @"/secret/{secretId}:delete";
    return self;
}
@end

/// 禁用机密
@implementation  KmsDisableSecretExecutor

-(id) initWithJDCloudClient:(KmsClient*)JDCloudClient
{
    self.jdCloudClient = JDCloudClient;
    self.method = @"PATCH";
    self.url = @"/secret/{secretId}:disable";
    return self;
}
@end

/// 禁用指定版本机密
@implementation  KmsDisableSecretVersionExecutor

-(id) initWithJDCloudClient:(KmsClient*)JDCloudClient
{
    self.jdCloudClient = JDCloudClient;
    self.method = @"PATCH";
    self.url = @"/secret/{secretId}/version/{version}:disable";
    return self;
}
@end

/// 创建一个CMK（用户主密钥），默认为启用状态
@implementation  KmsCreateKeyExecutor

-(id) initWithJDCloudClient:(KmsClient*)JDCloudClient
{
    self.jdCloudClient = JDCloudClient;
    self.method = @"POST";
    self.url = @"/key:create";
    return self;
}
@end

/// -   修改对称密钥配置，包括key的名称、用途、是否自动轮换和轮换周期等;
   /// -   修改非对称密钥配置，包括key的名称、用途等。
   /// 
@implementation  KmsUpdateKeyDescriptionExecutor

-(id) initWithJDCloudClient:(KmsClient*)JDCloudClient
{
    self.jdCloudClient = JDCloudClient;
    self.method = @"PATCH";
    self.url = @"/key/{keyId}";
    return self;
}
@end

/// 使用非对称密钥的私钥签名,签名算法仅支持RSA_PKCS1_PADDING填充方式,最大签名数据长度为4K字节
@implementation  KmsSignExecutor

-(id) initWithJDCloudClient:(KmsClient*)JDCloudClient
{
    self.jdCloudClient = JDCloudClient;
    self.method = @"POST";
    self.url = @"/key/{keyId}:Sign";
    return self;
}
@end

/// 获取机密详情
@implementation  KmsDescribeSecretVersionListExecutor

-(id) initWithJDCloudClient:(KmsClient*)JDCloudClient
{
    self.jdCloudClient = JDCloudClient;
    self.method = @"GET";
    self.url = @"/secret/{secretId}";
    return self;
}
@end

/// 导出机密
@implementation  KmsExportSecretExecutor

-(id) initWithJDCloudClient:(KmsClient*)JDCloudClient
{
    self.jdCloudClient = JDCloudClient;
    self.method = @"GET";
    self.url = @"/secret/{secretId}:export";
    return self;
}
@end

/// 使用非对称密钥的公钥验证签名
@implementation  KmsValidateExecutor

-(id) initWithJDCloudClient:(KmsClient*)JDCloudClient
{
    self.jdCloudClient = JDCloudClient;
    self.method = @"POST";
    self.url = @"/key/{keyId}:Validate";
    return self;
}
@end

/// 删除指定版本机密
@implementation  KmsDeleteSecretVersionExecutor

-(id) initWithJDCloudClient:(KmsClient*)JDCloudClient
{
    self.jdCloudClient = JDCloudClient;
    self.method = @"DELETE";
    self.url = @"/secret/{secretId}/version/{version}:delete";
    return self;
}
@end

/// 获取密钥详情
@implementation  KmsDescribeKeyExecutor

-(id) initWithJDCloudClient:(KmsClient*)JDCloudClient
{
    self.jdCloudClient = JDCloudClient;
    self.method = @"GET";
    self.url = @"/key/{keyId}";
    return self;
}
@end

/// 导入机密
@implementation  KmsImportSecretExecutor

-(id) initWithJDCloudClient:(KmsClient*)JDCloudClient
{
    self.jdCloudClient = JDCloudClient;
    self.method = @"POST";
    self.url = @"/secret:import";
    return self;
}
@end

/// 计划在以后的是个时间点删除密钥，默认为7天
@implementation  KmsScheduleKeyDeletionExecutor

-(id) initWithJDCloudClient:(KmsClient*)JDCloudClient
{
    self.jdCloudClient = JDCloudClient;
    self.method = @"DELETE";
    self.url = @"/key/{keyId}:delete";
    return self;
}
@end

/// 立即轮换密钥，自动轮换周期顺延-支持对称密钥
@implementation  KmsKeyRotationExecutor

-(id) initWithJDCloudClient:(KmsClient*)JDCloudClient
{
    self.jdCloudClient = JDCloudClient;
    self.method = @"PATCH";
    self.url = @"/key/{keyId}:rotate";
    return self;
}
@end

/// 获取机密列表
@implementation  KmsDescribeSecretListExecutor

-(id) initWithJDCloudClient:(KmsClient*)JDCloudClient
{
    self.jdCloudClient = JDCloudClient;
    self.method = @"GET";
    self.url = @"/secret";
    return self;
}
@end

/// 获取指定机密版本的详细信息
@implementation  KmsDescribeSecretVersionInfoExecutor

-(id) initWithJDCloudClient:(KmsClient*)JDCloudClient
{
    self.jdCloudClient = JDCloudClient;
    self.method = @"GET";
    self.url = @"/secret/{secretId}/version/{version}";
    return self;
}
@end

/// 禁用指定版本密钥
@implementation  KmsDisableKeyVersionExecutor

-(id) initWithJDCloudClient:(KmsClient*)JDCloudClient
{
    self.jdCloudClient = JDCloudClient;
    self.method = @"PATCH";
    self.url = @"/key/{keyId}/version/{version}:disable";
    return self;
}
@end

/// 使用密钥对数据进行解密，针对非对称密钥：使用私钥进行加密
@implementation  KmsDecryptExecutor

-(id) initWithJDCloudClient:(KmsClient*)JDCloudClient
{
    self.jdCloudClient = JDCloudClient;
    self.method = @"POST";
    self.url = @"/key/{keyId}:Decrypt";
    return self;
}
@end

/// 启用机密
@implementation  KmsEnableSecretExecutor

-(id) initWithJDCloudClient:(KmsClient*)JDCloudClient
{
    self.jdCloudClient = JDCloudClient;
    self.method = @"PATCH";
    self.url = @"/secret/{secretId}:enable";
    return self;
}
@end

/// 禁用当前状态为&#x60;已启用&#x60;的密钥
@implementation  KmsDisableKeyExecutor

-(id) initWithJDCloudClient:(KmsClient*)JDCloudClient
{
    self.jdCloudClient = JDCloudClient;
    self.method = @"PATCH";
    self.url = @"/key/{keyId}:disable";
    return self;
}
@end

/// 启用指定版本机密
@implementation  KmsEnableSecretVersionExecutor

-(id) initWithJDCloudClient:(KmsClient*)JDCloudClient
{
    self.jdCloudClient = JDCloudClient;
    self.method = @"PATCH";
    self.url = @"/secret/{secretId}/version/{version}:enable";
    return self;
}
@end

/// 计划在以后的是个时间点删除指定版本密钥，默认为7天
@implementation  KmsScheduleKeyVersionDeletionExecutor

-(id) initWithJDCloudClient:(KmsClient*)JDCloudClient
{
    self.jdCloudClient = JDCloudClient;
    self.method = @"DELETE";
    self.url = @"/key/{keyId}/version/{version}:delete";
    return self;
}
@end

/// 创建机密新的版本，默认为已启用状态
@implementation  KmsCreateSecretVersionExecutor

-(id) initWithJDCloudClient:(KmsClient*)JDCloudClient
{
    self.jdCloudClient = JDCloudClient;
    self.method = @"POST";
    self.url = @"/secret/{secretId}:createSecretVersion";
    return self;
}
@end

/// 获取版本详情
@implementation  KmsDescribeKeyDetailExecutor

-(id) initWithJDCloudClient:(KmsClient*)JDCloudClient
{
    self.jdCloudClient = JDCloudClient;
    self.method = @"GET";
    self.url = @"/key/{keyId}:describeKeyDetail";
    return self;
}
@end

/// 修改机密描述
@implementation  KmsUpdateSecretExecutor

-(id) initWithJDCloudClient:(KmsClient*)JDCloudClient
{
    self.jdCloudClient = JDCloudClient;
    self.method = @"PATCH";
    self.url = @"/secret/{secretId}";
    return self;
}
@end

/// 取消删除指定版本密钥
@implementation  KmsCancelKeyVersionDeletionExecutor

-(id) initWithJDCloudClient:(KmsClient*)JDCloudClient
{
    self.jdCloudClient = JDCloudClient;
    self.method = @"PATCH";
    self.url = @"/key/{keyId}/version/{version}:cancelDelete";
    return self;
}
@end
